<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@page import="java.util.List"%>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<title>我的日记</title>
		<link rel="stylesheet" type="text/css" href="layui-v2.6.8/layui/css/layui.css" />
		<style type="text/css">
			.layui-layout-body {
				overflow-y: auto;
			}

			#type {
				width: 110px;
				height: 40px;
				border: 0px;
				border-radius: 5px;
				text-align: center;
				background-color: #009688;
				color: white;
				margin-left: 50px;
			}
			td{
				width: 350px;
			}
			img {
				width: 300px;
				margin-top: 20px;
				padding-left: 20px;
			}
		</style>
	</head>
	<body>
		<div class="layui-layout layui-layout-admin">
			<div class="layui-header">
				<div class="layui-logo layui-hide-xs layui-bg-black"><%=session.getAttribute("name").toString() %>的MyDaily</div>
				<!-- 头部区域（可配合layui 已有的水平导航） -->
				<ul class="layui-nav layui-layout-left">

					<li class="layui-nav-item layui-hide-xs"><a href="home.jsp" id="my">编写日记</a></li>
					<li class="layui-nav-item layui-hide-xs"><a href="PageServlet?sid=1" id="">我的日记</a></li>
					<li class="layui-nav-item layui-hide-xs"><a href="" style="color: royalblue;">我的相册</a></li>
					<li class="layui-nav-item">
						<a href="javascript:;">更多</a>
						<dl class="layui-nav-child">
							<dd><a href="#"
									onclick="if(window.confirm('很抱歉，该功能暂未开放，敬请等待,')==false) return false">记事本</a></dd>
							<dd><a href="" onclick="if(window.confirm('很抱歉，该功能暂未开放，敬请等待,')==false) return false">备忘录</a>
							</dd>
						</dl>
					</li>
				</ul>
				<ul class="layui-nav layui-layout-right">
					<li class="layui-nav-item layui-hide layui-show-md-inline-block">
						<a href="" id="geren">
							<img src="//tva1.sinaimg.cn/crop.0.0.118.118.180/5db11ff4gw1e77d3nqrv8j203b03cweg.jpg"
								class="layui-nav-img">
							个人中心
						</a>
					</li>
					<li class="layui-nav-item layui-hide layui-show-md-inline-block">
						<a href="javascript:;">设置</a>
						<dl class="layui-nav-child">
							<dd><a href=""></a></dd>
							<dd><a href="#" id="moshi" onclick="qiehuan()">日间模式</a></dd>
							<dd><a href="userQuit">退出</a></dd>
						</dl>
					</li>
				</ul>
			</div>

			<div class="layui-side layui-bg-black">
				<div class="layui-side-scroll">
					<!-- 左侧导航区域（可配合layui已有的垂直导航） -->
					<ul class="layui-nav layui-nav-tree" lay-filter="test">
						<li class="layui-nav-item layui-nav-itemed">
							<a class="" href="javascript:;">历史日记</a>
							<dl class="layui-nav-child">
								<dd><a href="PageServlet?sid=2">最近一周</a></dd>
								<dd><a href="PageServlet?sid=3">最近一月</a></dd>
								<dd><a href="PageServlet?sid=4">最近一年</a></dd>
								<dd><a href="PageServlet?sid=5">更久</a></dd>
							</dl>
						</li>
						<li class="layui-nav-item">
							<a href="javascript:;">历史相册</a>
							<dl class="layui-nav-child">
								<dd><a href="javascript:;">最近一周</a></dd>
								<dd><a href="javascript:;">最近一月</a></dd>
								<dd><a href="javascript:;">最近一年</a></dd>
								<dd><a href="">更久</a></dd>
							</dl>
						</li>
					</ul>
				</div>
			</div>

			<div class="layui-body">
				<!-- 内容主体区域 -->
				<div style="padding: 15px;">
					<form method="post" action="addimg" enctype="multipart/form-data">
						<div style="width: 270px;height: 100px;border: 1px black solid;text-align: center;border-radius: 15px;display: inline-block;
							">
							<input type="file" name="file" style="height:100px;border-radius: 15px;" />
						</div>
						<input type="submit" value="上传"
							style="width: 80px;height: 40px;margin-left: 50px;position: absolute;top: 40px;" />
					</form>
				</div>
				<div id="show" style="width: 1700px;border: 1px black solid;height: 1500px;font-size: 20px;color: black;">
					<table border="" cellspacing="" cellpadding="">
						<tr>
						<c:forEach items="${list }" var="list">
							<td>
							<img src="img/${list.imgurl }"><br>
							<span style="padding-left: 20px;">${list.name }</span><br>
							<span style="padding-left: 20px;">${list.date }</span>
							<a href="deletimg?sid=${list.id }"
											onclick="if(window.confirm('您确定删除该条数据吗？')==false) return false"
											style="font-size: 20px; color: blue;">删除</a>
							</td>
							</c:forEach>
						</tr>
					</table>
				</div>
			</div>
		</div>
		<script src="js/jquery-3.6.0.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="layui-v2.6.8/layui/layui.js" type="text/javascript" charset="utf-8"></script>
		<script>
			//JS
			layui.use(['element', 'layer', 'util'], function() {
				var element = layui.element,
					layer = layui.layer,
					util = layui.util,
					$ = layui.$;

				//头部事件
				util.event('lay-header-event', {
					//左侧菜单事件
					menuLeft: function(othis) {
						layer.msg('展开左侧菜单的操作', {
							icon: 0
						});
					},
					menuRight: function() {
						layer.open({
							type: 1,
							content: '<div style="padding: 15px;">处理右侧面板的操作</div>',
							area: ['260px', '100%'],
							offset: 'rt' //右上角
								,
							anim: 5,
							shadeClose: true
						});
					}
				});

			});
			// 日间/夜间切换
			function qiehuan() {
				alert("很抱歉，该功能暂未开放，敬请等待")
			}

			function xuanze() {
				var num = document.getElementById("num")
				num.style.cssText =
					"background-color: #5FB878;display: inline-block;width: 50px;height: 33px;text-align: center;border: 1px #92B8B1 solid;";
			}
		</script>
	</body>
</html>
